package com.atguigu.boot.activemq.config;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;

import javax.jms.Queue;

/**
 * @description: 配置类
 * @program: boot_mq_produce
 * @author: Mr.Luo
 * @date: 2021-02-26 16:10
 **/
@Component
@EnableJms //开启适配Jms的注解
//@EnableScheduling
public class ConfigBean {
    @Value("${myqueue}")
    private String myQueue;
    @Bean //<bean id="" class=""/>
    public Queue queue(){
        return new ActiveMQQueue(myQueue);
    }

}
